package com.robot.clientfactory;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * User: li
 * Date: 2019/12/1
 * Time: 10:21
 * PROJECT：robot
 * PACKAGE: com.robot
 *
 * @author:55324936@qq.com To change this template use File | Settings | File Templates.
 */
@Component
public class ClientFactory {

    @Autowired
    DubboProcessor dubboProcessor;

    public ClientProcessor getClient(String interfaceType){
        if(interfaceType.equalsIgnoreCase("dubbo")){
            return dubboProcessor;
        }else if(interfaceType.equalsIgnoreCase("http")){
            return new HttpProcessor();
        }else {
            return null;
        }
    }
}
